Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metax] fix accuracy error of scatter in metax #459

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

mx-flaggems-user
Copy link
Collaborator

PR Category

Operater

Type of Change

Bug Fix

Description

We found that scatter with heur_block=128 will calculate wrong answer, so need to change it to 256 while running in metax backend

@@ -17,6 +17,7 @@ def generate_imports(code: IndentedBuffer) -> IndentedBuffer:
code.newline()
code.writeline("from flag_gems.utils import libentry")
code.writeline("from flag_gems import runtime")
code.writeline("from flag_gems.runtime import device")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import flag_gems and now has attr vendor_name, metax can use flag_gems.vendor_name,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -35,6 +36,9 @@ def generate_scatter_kernel(

code.writeline("def heur_block(args):")
with code.indent():
code.writeline("if(device.get_vendor_name()=='metax'):")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flag_gems.vendor_name

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -17,6 +17,7 @@ def generate_imports(code: IndentedBuffer) -> IndentedBuffer:
code.newline()
code.writeline("from flag_gems.utils import libentry")
code.writeline("from flag_gems import runtime")
code.writeline("from flag_gems")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import flag_gems, not from flag_gems

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Galaxy1458
Galaxy1458 previously approved these changes Feb 28, 2025
Copy link
Collaborator

@Galaxy1458 Galaxy1458 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator

@Galaxy1458 Galaxy1458 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Galaxy1458 Galaxy1458 merged commit c1acc44 into FlagOpen:master Feb 28, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants